cmake_minimum_required(VERSION 3.0.0)

# SET(CMAKE_C_COMPILER "/usr/local/bin/gcc")
# SET(CMAKE_CXX_COMPILER "/usr/local/bin/g++")
project(test1 VERSION 0.1.0)

include(CTest)
enable_testing()


# export CC=/usr/local/bin/gcc
# export CXX=/usr/local/bin/g++
message(":" (${CMAKE_CXX_COMPILER_VERSION}))

add_compile_options(-std=c++20)
#set(CMAKE_CXX_STANDARD 20)
add_executable(sem_thread
    ./src/sem_thread.cpp
)
add_executable(sem_process_read
    ./src/sem_process_read.cpp
)
add_executable(sem_process_write
    ./src/sem_process_write.cpp
)
add_executable(sem_c++
    ./src/sem_c++.cpp
)

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)

find_package(Threads REQUIRED)
target_link_libraries(sem_thread Threads::Threads)
target_link_libraries(sem_process_read Threads::Threads)
target_link_libraries(sem_process_write Threads::Threads)
target_link_libraries(sem_c++ Threads::Threads)